package com.io.example.demoparent.simpleness.order;


import com.io.example.demoparent.simpleness.Pizza;
import com.io.example.demoparent.simpleness.factory.SimpleFactory;

/**
 * 订购
 */
public class OrderPizza {


    private String type;
    /**
     * 创建简单工厂
     */
    private SimpleFactory simpleFactory;

    public OrderPizza(String type, SimpleFactory simpleFactory) {
        this.type = type;
        this.simpleFactory = simpleFactory;
    }

    /**
     * 根据客户传递类型构造不同披萨
     *
     * @return
     */
    public Pizza createOrder() {
        return simpleFactory.createPizza(type);
    }


}
